package com.dq.demo;
import java.util.Random;

public class Bigblock {		//	大方块类
	
	public Smallblock[] bb = new Smallblock[4]; 			//每个大方块由4个小方块组成
	
	
	public void leftMove() {						//大方块左移
		for(Smallblock Bb: bb) {								//遍历bb这个小方块数组
			Bb.left();
		}
	}
	
	public void rigthMove() {					//大方块右移
		for(Smallblock Bb: bb) {								//遍历bb这个小方块数组
			Bb.rigth();
		}
	}
	
	public void dropMove() {						//大方块下移
		for(Smallblock Bb: bb) {								//遍历bb这个小方块数组
			Bb.drop();
		}
	}
	
	public static Bigblock createBigblock(){//生成大方块
		
		Bigblock Bb = null;
		
		Random ra =new Random();
		int a = ra.nextInt(7)+1;								//一共有7中大方块，随机生成一种
		
		switch(a) {
		case 1: Bb = new T();break;
		case 2: Bb = new Z();break;
		case 3: Bb = new O();break;
		case 4: Bb = new I();break;
		case 5: Bb = new J();break;
		case 6: Bb = new L();break;
		case 7: Bb = new S();break;
		default: break;
		}
		return Bb;											
	}


}
